import request from '../../api/request'

// 停止发薪
export function stopPay(data) {
    return request.put('/api/v1/pay/payment-record/updateStatus', data).then(res => {
        return res.data.data
    })
}
// 项目账单
export function billStatistics(data) {
    return request.get('/api/v1/pay/payment-record/bill-count', data).then(res => {
        return res.data.data
    })
}
// 停止发薪单全部人员发薪
export function stopAllPay(data) {
    return request.put('/api/v1/pay/payment-record/updateStatusAll', data).then(res => {
        return res.data.data
    })
}

// 工资条列表
export function payrollList(data) {
    return request.get('/api/v1/pay/pay-stub/list', data).then(res => {
        return res.data.data
    })
}
// 工资条人员列表
export function payrollPeople(data) {
    return request.get('/api/v1/pay/pay-stub/list-detail', data).then(res => {
        return res.data.data
    })
}
// 工资条详情
export function payrollDetail(data) {
    return request.get('/api/v1/pay/pay-stub/detail', data).then(res => {
        return res.data.data
    })
}
// 设备管理列表
export function equipmentList(data) {
    return request.get('/api/v1/pay/ibeacon/list', data).then(res => {
        return res.data.data
    })
}
// 删除设备管理列表
export function equipmentDetalie(data) {
    return request.post('/api/v1/pay/ibeacon/empty', data).then(res => {
        return res.data.data
    })
}
// 编辑设备管理列表
export function equipmentModify(data) {
    return request.put('/api/v1/pay/ibeacon', data).then(res => {
        return res.data.data
    })
}
// 修改项目里的设备
export function projectEquipmentModify(data) {
    return request.post('/api/v1/pay/ibeacon/ibeacon-binding', data).then(res => {
        return res.data.data
    })
}

// 添加考勤机
export function addEquipment(data) {
    return request.post('/api/v1/pay/ibeacon/add-ibeacon', data).then(res => {
        return res.data.data
    })
}
// 审核详情
export function getExamineInfo(data) {
    return request.get('/api/v1/pay/sp-process-order', data).then((res) => {
        return res.data.data
    })
}

// 审批
export function approval(data) {
    return request.post('/api/v1/pay/sp-process-order/audit', data).then((res) => {
        return res.data.data
    })
}
// 猜你想加
export function getAIBook(data) {
    return request.get('/api/v1/pay/address-book/listGetGuess', data).then((res) => {
        return res.data.data
    })
}
// 流程单的名单详情
export function getFlowWorkerList(data) {
    return request.get('/api/v1/pay/sp-process-order/list-info', data).then((res) => {
        return res.data.data
    })
}

// 导出发薪名单
export function exportWorkerPriceList(data) {
    return request.get('/api/v1/pay/payment-record/export', data).then((res) => {
        return res.data.data
    })
}

// 导出预支名单
export function exportadvcnceWorkerPriceList(data) {
    return request.get('/api/v1/pay/advance/record/export-staff-list', data).then((res) => {
        return res.data.data
    })
}

// 创建快速发薪项目
export function createQuickProject(data) {
    return request.post('/api/v1/pay/company-supplier/quick-project', data).then(res => {
        return res.data.data
    })
}

// 获取快速发薪项目详情
export function getQuickProject(data) {
    return request.get('/api/v1/pay/worker-project-record/list-quick-pay', data).then(res => {
        return res.data.data
    })
}

// 获取长期工项目有人员的日期
export function getLongProjectDate(data) {
    return request.get('/api/v1/pay/project/month-to-day-project-result', data).then((res) => {
        return res.data.data
    })
}
// 获取长期工发薪人员信息
export function getLongProjectWorker(data) {
    return request.get('/api/v1/pay/project/all-sign-result', data).then((res) => {
        return res.data.data
    })
}
// 获取流程单号
export function getFlowUUID(data) {
    return request.get('/api/v1/pay/sp-process-order/flow-code', data).then((res) => {
        return res.data.data
    })
}

// 创建发薪流程单
export function createPayFlow(data) {
    return request.post('/api/v1/pay/sp-process-order', data).then((res) => {
        return res.data.data
    })
}
// 设置项目中人员置顶
export function setProjectWorkerTop(data) {
    return request.put('/api/v1/pay/worker-project-record/top', data).then((res) => {
        return res.data.data
    })
}
// 查询已归档
export function placeFileList(data) {
    return request.get('/api/v1/pay/project/archive-project-list', data).then(res => {
        return res.data.data
    })
}

// 获取账单列表
export function getBillList(data) {
    return request.get('/api/v1/pay/sp-process-order/bill-list', data).then(res => {
        return res.data.data
    })
}

// 获取公司充值账号
export function getCompanyPayAccount(data) {
    return request.get('/api/v1/pay/company', data).then((res) => {
        return res.data.data
    })
}

// 获取发薪的人员列表
export function getPayWorkerList(data) {
    return request.get('/api/v1/pay/worker-project-record/daily-list-pay', data).then((res) => {
        return res.data.data
    })
}
// 设置长期工项目打卡时间和押薪天数
export function setProjectClockTime(data) {
    return request.post('/api/v1/pay/project/edit-sign-rule', data).then((res) => {
        return res.data.data
    })
}

// 设置长期工项目打卡地点
export function setProjectClockAddress(data) {
    return request.post('/api/v1/pay/project/edit-sign-location', data).then((res) => {
        return res.data.data
    })
}

// 审核列表
export function getExamineList(data) {
    return request.get('/api/v1/pay/sp-process-order/list-audit', data).then((res) => {
        return res.data.data
    })
}

// 设置关注状态
export function setAttention(data) {
    return request.put('/api/v1/pay/manager/subscription', data).then(res => {
        return res.data.data
    })
}

// 批量审批
export function batchApproval(data) {
    return request.post('/api/v1/pay/sp-process-order/audit-batch', data).then((res) => {
        return res.data.data
    })
}

// 发票下载列表
export function getiInvoiceList(data) {
    return request.get('/api/v1/pay/invoice/list', data).then((res) => {
        return res.data.data
    })
}
// 发票申请
export function getiInvoiceApply(data) {
    return request.put('/api/v1/pay/invoice/voice-status', data).then((res) => {
        return res.data.data
    })
}
// 发票下载
export function getiInvoiceDownload(data) {
    return request.get('/api/v1/pay/invoice/add-record', data).then((res) => {
        return res.data.data
    })
}
// 发票下载详情
export function getiInvoiceDetailList(data) {
    return request.get('/api/v1/pay/invoice/download-record', data).then((res) => {
        return res.data.data
    })
}
// 拿到附近建筑信息 https://cloudcode.51zidan.com/api/amap?location=116.490377,39.975437&keywords=%E6%B1%9F%E5%8D%97&type=inputtips
// 拿到附近建筑信息 新接口 https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(40.040589,116.273543,1000)&keyword=公园&page_size=10&page_index=1&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77
// 拿到附近建筑信息 老接口 https://cloudcode.51zidan.com/api/amap?location=116.490377,39.975437&keywords=%E6%B1%9F%E5%8D%97&type=inputtips
// https://cloudcode.51zidan.com/api/amap
export function getAmap(data) {
    // return request.get('https://cloudcode.51zidan.com/api/amap', data).then((res) => {
    return request.get('https://apis.map.qq.com/ws/place/v1/search', data).then((res) => {
        return res.data
    })
}

// 逆地理解析位置 顺便拿到周边信息
export function getGeocoder(data) {
    return request.get('https://apis.map.qq.com/ws/geocoder/v1', data).then((res) => {
        return res.data
    })
}

// 修改年龄限制 api/v1/pay/project/update-age-range

export function updateAgeRange(data) {
    return request.post('/api/v1/pay/project/update-age-range', data).then((res) => {
        return res.data.data
    })
}

// 新 发薪项目列表接口 api/v1/pay/worker-project-record/worker-list
export function getPayDetailList(data) {
    return request.get('/api/v1/pay/worker-project-record/worker-list', data).then(res => {
        return res.data.data
    })
}

// 新 发薪详细信息接口 api/v1/pay/project/info
export function getPayDetailInfo(data) {
    return request.get('/api/v1/pay/project/info', data).then(res => {
        return res.data.data
    })
}

// 名单整理人员列表 api/v1/pay/worker-project-record/worker-list-group
export function getWorkerListGroup(data) {
    return request.get('/api/v1/pay/worker-project-record/worker-list-group', data).then(res => {
        return res.data.data
    })
}

// 项目管理员列表 api/v1/pay/project-leader
export function getProjectLeaderList(data) {
    return request.get('/api/v1/pay/project-leader', data).then(res => {
        return res.data.data
    })
}

// 发薪项目修改接口 api/v1/pay/project/update-info
export function updatePayEnterpriseInfo(data) {
    return request.post('/api/v1/pay/project/update-info', data).then((res) => {
        return res.data.data
    })
}

// 发薪人员整理批量设置备注 api/v1/pay/worker-project-record/updateRemark
export function setRemark(data) {
    return request.put('/api/v1/pay/worker-project-record/updateRemark', data).then(res => {
        return res.data.data
    })
}

// 项目管理员移除 api/v1/pay/project-leader/delete
export function setProjectLeaderDelete(data) {
    return request.put('/api/v1/pay/project-leader/delete', data).then(res => {
        return res.data.data
    })
}

// 导入发薪项目人员 api/v1/pay/worker-project-record/add-from-project
export function addFromProject(data) {
    return request.post('/api/v1/pay/worker-project-record/add-from-project', data).then((res) => {
        return res.data.data
    })
}
// 批量删除人员 api/v1/pay/worker-project-record/delete-batch
export function deleteProjectBatchStaff(data) {
    return request.post('/api/v1/pay/worker-project-record/delete-batch', data).then((res) => {
        return res.data.data
    })
}

// 根据id用户信息 api/v1/pay/worker-project-record/worker-list-ids
export function getDeleteworkerListIds(data) {
    return request.get('/api/v1/pay/worker-project-record/worker-list-ids?ids=' + data).then(res => {
        return res.data.data
    })
}

// 获取项目信息 api/v1/pay/project/info
export function getProjectDetailInfo(data) {
    return request.get('/api/v1/pay/project/info', data).then(res => {
        return res.data.data
    })
}

// 员工账单查询
export function staffReckoning(data) {
    return request.get('/api/v1/pay/payment-record/bill-worker', data).then(res => {
        return res.data.data
    })
}

// 账单详情 发薪人员查询
export function circumstancePayment(data) {
    return request.get('/api/v1/pay/payment-record/bill-info-list', data).then(res => {
        return res.data.data
    })
}

// 账单详情 员工领薪详情页
export function getPaid(data) {
    return request.get('/api/v1/pay/payment-record/info-id', data).then(res => {
        return res.data.data
    })
}

// 导出列表
export function educeSummarizing(data) {
    return request.get('/api/v1/pay/payment-record/export', data).then(res => {
        return res.data.data
    })
}

// 发薪限制功能 /api/v1/pay/company/get-company-single-quota
export function getCompanySingleQuota(data) {
    return request.get('/api/v1/pay/company/get-company-single-quota', data).then(res => {
        return res.data.data
    })
}

// 获取发票信息
export function getBillInfo(data) {
    return request.get('/api/v1/system/company-extend', data).then(res => {
        return res.data.data
    })
}

// 新增发票信息 
export function addBillInfo(data) {
    return request.post('/api/v1/system/company-extend', data).then((res) => {
        return res.data.data
    })
}

// 编辑发票信息 
export function editBillInfo(data) {
    return request.put('/api/v1/system/company-extend', data).then((res) => {
        return res.data.data
    })
}

// 项目账单列表数据
export function getxmzdlistapi(data) {
    return request.get('/api/v1/pay/sp-process-order/project-bill-list', data).then((res) => {
        return res.data.data
    })
}

// 项目账单汇总数据
export function getbillcountapi(data) {
    return request.get('/api/v1/pay/sp-process-order/bill-count', data).then((res) => {
        return res.data.data
    })
}

// 项目账单详情
export function getprojectbillinfoapi(data) {
    return request.get('/api/v1/pay/sp-process-order/project-bill-info', data).then((res) => {
        return res.data.data
    })
}

// 获取项目账单详情信息
export function getbillinfoapi(data) {
    return request.get('/api/v1/pay/sp-process-order/bill-info', data).then((res) => {
        return res.data.data
    })
}

// 员工账单
export function getemployeesalaryapi(data) {
    return request.get('/api/v1/pay/payment-record/get-employee-salary-bill', data).then((res) => {
        return res.data.data
    })
}

// 员工账单-领薪记录
export function getemployeesalaryrecordapi(data) {
    return request.get('/api/v1/pay/payment-record/get-employee-salary-record', data).then((res) => {
        return res.data.data
    })
}

// 员工账单头部
export function getemployeesalaryheadapi(data) {
    return request.get('/api/v1/pay/payment-record/get-employee-salary_head', data).then((res) => {
        return res.data.data
    })
}

// 员工账单-导出记录
export function exportemployeesalaryrecordapi(data) {
    return request.get('/api/v1/pay/payment-record/export-employee-salary-record', data).then((res) => {
        return res.data.data
    })
}

// 账单明细
export function paybillrecordapi(data) {
    return request.get('/api/v1/pay/sp-process-order/pay-bill-record', data).then((res) => {
        return res.data.data
    })
}

// 预支账单列表
export function getadvancezdlistapi(data) {
    return request.get('/api/v1/pay/advance/record/list', data).then((res) => {
        return res.data.data
    })
}

// 停止预支
export function updateStatusapi(data) {
    return request.put('/api/v1/pay/advance/record/updateStatus', data).then((res) => {
        return res.data.data
    })
}

// 预支账单头部信息
export function getspprocessorderpaybillheadapi(data) {
    return request.get('/api/v1/pay/advance/record/advance-bill-head', data).then((res) => {
        return res.data.data
    })
}

export function spprocessorderpaybillhead(data) {
    return request.get('/api/v1/pay/sp-process-order/pay-bill-head', data).then((res) => {
        return res.data.data
    })
}

// 查询企业可使用发薪账户
export function getQueryCompanyPayPlatform(data) {
    return request.get('/api/v1/pay/company/query-company-pay-platform', data).then((res) => {
        return res.data.data
    })
}

// 查询企业发薪金额是否上限
export function checkTotalMoneySumApi(data) {
    return request.post('/api/v1/pay/sp-process-order/checkTotalMoneySum', data).then((res) => {
        return res.data.data
    })
}